<%-- 
    Document   : logout
    Created on : 25/09/2013, 02:52:06 PM
    Author     : Sistema
--%>
<%@page session='true'%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        
        <%
         
        HttpSession newSesion  ;  
        newSesion = request.getSession(false);
        
        newSesion.setAttribute("sessionId", ""); 
        
        
           
                        Cookie cookie = null;
                      Cookie[] cookies = null; 
                        // Get an array of Cookies associated with this domain
                      cookies = request.getCookies();
   
                      if( cookies != null ){ 
                        for (int i = 0; i < cookies.length; i++){
          
                         cookie = cookies[i];
                            
                          if(cookie.getName().equals("billing") && !cookie.getValue().equals("")){
                            Cookie cookie_2 = new Cookie("billing" , "" );
                              cookie_2.setMaxAge(0);
                              cookie = cookie_2;
                              response.addCookie(cookie);
                           } 
                        }
                     } 
           
                      
         response.sendRedirect("logout2"); 
        %>
       
    </body>
</html>

